const router = require('koa-router')();
const knowledge = require('../modules/knowledge');

//获取数据
router.get('/examknowledge',async(ctx,next) => {
    ctx.body = await knowledge.getexamKnowledge();
})
//增加数据
router.post('/examknowledge',async(ctx,next) => {
    ctx.body = await knowledge.addexamKnowledge(ctx.request.body);
})
//删除数据
router.delete('/examknowledge/:know_id',async(ctx,next) => {
    ctx.body = await knowledge.deleteexamKnowledge(ctx.params);
})
//修改数据
router.put('/examknowledge',async(ctx,next)=>{
    ctx.body = await knowledge.putexamKnowledge(ctx.request.body);
})

module.exports = router;
